import SendGQL from "@/api/SendGQL";
//寺庙列表
const ListTemple = `
  query ListTemple ( $name: String , $perPage: Int64!, $page: Int64!) {
    listTemple (name: $name , perPage: $perPage, page: $page) {
    count
      list{
        createTime
        department
        id
        name
        remarks
        sects
        stationName
        templeimg
        township
      }
    }
  }
`;

export const listTemple = (params) => {
  const { name, perPage, page } = params;
  return SendGQL({
    query: ListTemple,
    variables: {
      name,
      perPage,
      page,
    },
  });
};
//事故列表
const ListAccident = `
  query ListAccident ($name: String, $companyId: String, $companyName: String, $status: accidentStatusEnum, $perPage: Int64!, $page: Int64!) {
    listAccident (name: $name, companyId: $companyId, companyName: $companyName, status: $status, perPage: $perPage, page: $page) {
      count
      list{
        companyId
        companyName
        createTime
        filingTime
        fine
        id
        img
        name
        preventFine
        remarks
        status
        stationName
      }
    }
  }
`;

export const listAccident = (params) => {
  const { name, companyId, companyName, status, perPage, page } = params;
  return SendGQL({
    query: ListAccident,
    variables: {
      name,
      companyId,
      companyName,
      status,
      perPage,
      page,
    },
  });
};

//车辆列表查询
const ListCar = `
  query ListCar ($class: String,  $perPage: Int64!, $page: Int64!) {
    listCar (class: $class, perPage: $perPage, page: $page) {
      count
      list{
        cardId
        class
        color
        createTime
        id
        img
        licensePlate
        model
        name
        remarks
        stationName
      }
    }
  }
`;

export const listCar = (params) => {
  const { perPage, page } = params;
  return SendGQL({
    query: ListCar,
    variables: {
      perPage,
      page
    },
  });
};

//佛寺活动列表查询
const ListActivity = `
  query ListActivity ($title: String,  $perPage: Int64!, $page: Int64!) {
    listActivity (title: $title, perPage: $perPage, page: $page) {
      count
      list{
        createTime
        hold
        id
        name
        place
        remarks
        state
        time
        type
        stationName
      }
    }
  }
`;

export const listActivity = (params) => {
  const { title, perPage, page } = params;
  return SendGQL({
    query: ListActivity,
    variables: {
      title,      
      perPage,
      page
    },
  });
};


